Mapping functions are used to apply two-dimensional textures to
surfaces. Each mapping functions defines a different method of transforming
a three dimensional point of intersection to a two dimensional u - v pair
termed texturing coordinates.
Typically, the arguments to a mapping method define a center of
a projection and two non-parallel axes that define a local coordinate system.
The default mapping method is termed u - v mapping or inverse mapping.
Normally, there is a different inverse mapping method for each primitive type
(see chapter 5).
When inverse mapping is used, the point of intersection is passed to
the uv method for the primitive that was hit.
- map uv
Use the uv (inverse mapping) method associated with the
object that was intersected in order to map from 3D to determine
texturing coordinates.
The inverse mapping method for each primitive is described in Chapter 5.
- map planar [
]
Use a planar mapping method. The 2D texture is transformed
so that its u axis is given by
and its v
axis by vaxis. The texture is projected along the vector
defined by the cross product of the u and v axes, with
the (0,0) in texture space mapped to
.
- map cylindrical [
]
Use a cylindrical mapping method. The point of intersection
is projected onto an imaginary cylinder, and the location
of the projected point is used to determine the texture coordinates.
If given,
and
define the cylinder's axis, and
defines
where u = 0 is located.
See the description of the inverse mapping method for the
cylinder in Chapter 5. By default, the point of intersection is
projected onto a cylinder that runs through the origin along the z
axis, with
equal to the x axis.
- map spherical [
]
Use a spherical mapping method. The intersection point is
projected onto an imaginary sphere, and the location of the
projected point is used to determine the texturing coordinates
in a manner identical to that used in the inverse mapping method
for the sphere primitive.
If given, the center of
the projection is
,
defines
the sphere axis, and the point where the
non-parallel
intersects the sphere
defines where u = 0 is located.
By default, a spherical mapping projects points towards the origin,
with
defined to be the z axis and
defined to be the x axis.